package com.wx.chapter10.static_;

/**
 * ClassName:VisitStatic
 * Package :com.wx.chapter10.static_
 * Description :
 *
 * @Author : coder_mu
 * @Create : 2023/6/2 - 15:07
 */
public class VisitStatic {
    public static void main(String[] args) {
        A a = new A();
        //静态变量即使没有创建对象也可以访问，其在加载类时就自动创建了
//        System.out.println(a.getName);
        System.out.println(A.getName());
    }
}
class A{
    private static String name = "bian";

    public static String getName() {
        return name;
    }

    public static void setName(String name) {
        A.name = name;
    }

    public A() {
    }
}
